<%--
  User: Shengzhao Li
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>日志内容</title>

</head>
<body>
<%--log details page--%>
<div id="log_details_page" data-role="page" class="page">
    <div data-role="header" data-theme="f">
        <a href="${contextPath}/m/dashboard" data-icon="home" data-direction="reverse"
           data-transition="slide">主页</a>

        <h1>日志内容</h1>
        <a href="../overview" data-icon="arrow-l" data-direction="reverse" data-transition="slide">返回</a>
    </div>
    <div data-role="content">
        <div class="ui-bar-c ui-corner-top ui-corner-bottom details-area">
            <p><strong>类型:</strong>&nbsp;${logDetails.logType.name}
                <c:if test="${logDetails.privateLog}">
                    <img src="${contextPath}/images/mobile/lock.png" alt="private"/>
                </c:if>
            </p>

            <p><strong>日期:</strong>&nbsp;${logDetails.logDate}</p>

            <p><strong>记录时间:</strong>&nbsp;${logDetails.createFullTime}</p>

            <c:if test="${logDetails.logged}">
                <p><strong>创建者:</strong>&nbsp;${logDetails.allowEdit?'本人':logDetails.user.showName}</p>
            </c:if>

            <p>
                <strong>内容:</strong>
                <br>
                ${logDetails.content}
            </p>
        </div>

        <div>
            <ul data-role="listview" data-inset="true" data-dividertheme="b">
                <li data-role="list-divider">评论</li>
                <c:forEach items="${logDetails.comments}" var="comm">
                    <li>
                        <a href="../comment/${comm.guid}" data-transition="slideup">
                            <strong>${comm.creator.showName} 说: </strong> ${comm.content}
                        </a>
                    </li>
                </c:forEach>
                <c:if test="${empty logDetails.comments}">
                    <li>没有评论.</li>
                </c:if>
            </ul>
        </div>
        <%--action--%>
        <div data-role="controlgroup">
            <c:if test="${logDetails.logged}">
                <a href="../comment/form?logGuid=${logDetails.guid}" data-role="button" data-icon="plus">说两句</a>
            </c:if>
            <c:if test="${logDetails.allowEdit}">
                <a href="../form?guid=${logDetails.guid}" data-role="button" data-icon="forward"
                   data-transition="slidedown">编辑</a>
                <a href="../confirm_delete/${logDetails.guid}" data-role="button" data-icon="delete" class="red"
                   data-transition="slidedown">删除</a>
            </c:if>
            <a href="../overview" data-role="button" data-icon="arrow-l" data-direction="reverse"
               data-transition="slide">返回</a>
        </div>

    </div>
</div>
</body>
</html>